$(document).ready(
    function() {

        $("message").change(function(e) {
            alert('dsfd'); // $(this).blur();
        });



        $("#Button1").click(function() {
            alert("Hello world!");
        });


        $("form").submit(function() {
            // event.preventDefault();
            // alert('Handler for .submit() called.');
            $.ajax({
                data: $.param($(this).serializeArray()),
                dataType: 'script',
                type: 'get',
                url: './chatControl/processMessage.aspx',

                success: function(response) {
                    // alert('Handler for .submit() called.');
                },

                failure: function(msg) {
                    alert(msg);
                   // $('#categoryDetails').text(msg);
                }

            }


            );
            // alert('Handler for .submit() called.');
            // we clean the message textbox and focus it..
            $('#message').val("");
            $('#message').focus();

            return false;

        });
    })

    setInterval(function() {
    $.ajax({
        success:function(request){
            $('#chat').html(request);
        },
        url:'./chatControl/data.aspx',
        cache: false
    })
}, 1000)
